#include<bits/stdc++.h>
using namespace std;

int check(int num,int n)
{
	int ans=0;
	while(num>0)
	{
		ans=ans+num%n;
		num/=n;
	}
	return ans;
}

int main()
{
	int i=1;	
	int sum=1;
	while(1)
	{
		if(i%(check(i,2))==0&&i%(check(i,8))==0&&i%(check(i,10))==0&&i%(check(i,16))==0)
		{
			cout<<"sum:"<<sum<<" i:"<<i<<"\n";
			sum++;
		}
		if(sum==2024)
			break;
		i++;
	}
	return 0;
}
